var mysql = require('mysql');
var conn = mysql.createConnection({
	host: 'localhost',
	port: 3306,
	user: 'root',
	password: 'root',
	database: 'test',	multipleStatements: true
});

conn.connect();



function exeSqls(conn, sql, pms, i, fn) {
	var pm = pms[i]
	conn.query(sql, pm, function(err, data) {
		if (i < pms.length-1) {
			exeSqls(conn, sql, pms, i + 1, fn(err, data))
		}

	})
}

var sql = "insert into user (name,age,intro) values(?,?,?)";
var pms = [
	['wang', 33, 'wangIntro'],
	['kk', 55, 'kkIntro']
];

exeSqls(conn, sql, pms, 0, function(err, data) {
	if (err) throw err;
	console.log(data);

	conn.query('select * from user', function(err, rows) {
		console.log(rows);
		conn.end();
	})

})